
//	------------------------------------------------------------------------------
//                                       _                          
//              _ __ ___   ___ _ __ ___ | |__  _ __ __ _ _ __   ___ 
//             | '_ ` _ \ / _ \ '_ ` _ \| '_ \| '__/ _` | '_ \ / _ \
//             | | | | | |  __/ | | | | | |_) | | | (_| | | | |  __/
//             |_| |_| |_|\___|_| |_| |_|_.__/|_|  \__,_|_| |_|\___|
//                                                     
//	------------------------------------------------------------------------------

#region - License -
//
//	------------------------------------------------------------------------------                                                   
//	         Copyright (c) 2010 Peter Vyvey (peter.vyvey@chiliware.be)
//	------------------------------------------------------------------------------
//
//
//	This file is part of CHILIWARE MEMBRANE.
//
//	CHILIWARE MEMBRANE is free software: you can redistribute it and/or modify
//	it under the terms of the GNU Lesser General Public License as published by
//	the Free Software Foundation, either version 3 of the License, or
//	(at your option) any later version.
//
//	CHILIWARE MEMBRANE is distributed in the hope that it will be useful,
//	but WITHOUT ANY WARRANTY; without even the implied warranty of
//	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//	GNU Lesser General Public License for more details.
//
//	You should have received a copy of the GNU Lesser General Public License
//	along with CHILIWARE MEMBRANE.  If not, see <http://www.gnu.org/licenses/>.
//
//
#endregion

#region - Changes -
//
//	peter.vyvey@chiliware.be		2010-08-10		Created
//
#endregion

#region - Using -

using System.Runtime.Serialization;

#endregion

namespace Chiliware.Membrane.ExceptionManagement
{
    #region - ServiceFault -

	/// <summary>
	/// The default fault send to WCF client application.
	/// </summary>
    [DataContract(Namespace = Namespace.FAULT_CONTRACT, Name = "ServiceFault")]
	public abstract class ServiceFault : 
		IServiceFault
	{
		#region - Constructors -

		/// <summary>
		/// Default constructor.
		/// </summary>
		private ServiceFault() 
			: base() { }

		/// <summary>
		/// Constructor with parameter.
		/// </summary>
		/// <param name="message">The fault message.</param>
		public ServiceFault(string message) : this()
		{
			this.Message = message;
		}

		/// <summary>
		/// Constructor with parameters.
		/// </summary>
		/// <param name="number">The exception number.</param>
		/// <param name="message">The fault message.</param>
		public ServiceFault(ExceptionNumber number, string message)
			: this(message)
		{
			this.Number = number;
		}

		#endregion

		#region - Properties -

		/// <summary>
		/// The <see cref="ExceptionNumber"/> of the service fault.
		/// </summary>
		/// <remarks>
		/// This <see cref="ExceptionNumber"/> provides an obfuscation of the original message an can be used in the UI.
		/// </remarks>
		[DataMember(IsRequired = false)]
		public ExceptionNumber Number { get; set; }

		/// <summary>
		/// The fault message.
		/// </summary>
		[DataMember(IsRequired = true)]
		public string Message { get; set; }

		#endregion
	}

	#endregion
}
